package sctu.edu.java.year2016.team08.chenjing.day20160601.chapter10_3;



import java.util.HashMap;
import java.util.Map;

/**创建Map集合，创建Emp对象，并将创建的Emp对象添加到集合中（Emp对象的id作为集合的键），并将id为005的对象从集合中移除。
 * Created by AD on 2016/6/1.
 */
public class TianJia {
    public static void main(String[] args) {
        Map<String,String > Emp=new HashMap<String,String>();
       Emp.put("001","红");
        Emp.put("002","橙");
        Emp.put("003","黄");
        Emp.put("004","绿");
        Emp.put("005","青");
        Emp.put("006", "蓝");
        Emp.put("007", "紫");
        for (String key : Emp.keySet()) {
            System.out.print(key + "  " + Emp.get(key) + "\t");
        }
        System.out.println();

        Emp.remove("005", "青");
        for (String key : Emp.keySet()) {
            System.out.print(key + "  " + Emp.get(key) + "\t");
        }
    }
}
